<template>
<div>
  <div class="xiandou_now">
    <span class="main_info_title">目标专注豆：</span>
    <i class="xiandou_center"></i>
    <span>{{ allCount ? tranform(allCount) : 0 }}</span>
  </div>
  <div class="xiandou_now">
    <span class="main_info_title">当前专注豆：</span>
    <i class="xiandou_center"></i>
    <span>{{ count ? tranform(count) : 0 }}</span>
  </div>
  <div class="process">
    <div class="processing" :style="{ 'width': percent + '%' }"></div>
  </div>
</div>
</template>

<script>
import { countForShow } from '../../utils'

export default {
  props: {
    count: Number,
    allCount: Number,
  },
  data() {
    return {
    }
  },
  computed: {
    percent() {
      return this.allCount ? (this.count / this.allCount * 100).toFixed(2) : 0;
    },
  },
  methods: {
    tranform(count) {
      return countForShow(count);
    },
  },
}
</script>

<style lang="less" scoped>
.xiandou_now {
  margin: 9px 0;
}
.xiandou_now span {
  display: inline-block;
  margin-left: 12px;
  font-family: PingFangSC-Medium;
  font-size: 20px;
  color: #FFFFFF;
}
.xiandou_center {
  background: url(~@/assets/images/bean.png);
  width: 36px;
  height: 36px;
  display: inline-block;
  vertical-align: middle;
  background-size: 100%;
  background-color: #fff;
  border-radius: 50%;
}
.process {
  position: relative;
  margin-top: 14px;
  width: 325px;
  background: #2A1E69;
  height: 9px;
  border-radius: 5px;
  .processing {
    top: 0;
    left: 0;
    height: 9px;
    background: #F56D7B;
    border-radius: 5px 0 0 5px;
  }
}
</style>